function containsDuplicate(nums: number[]): boolean {
  for (let index = 0; index < nums.length; index++) {
    if (nums.includes(nums[index], index + 1)) return true;
  }
  return false;
}
console.log(containsDuplicate([1, 2,3,4]));
